package Lian02;

/**
 * 杨辉三角
 */
public class BuGuiZeShuZu {
    public static void main(String[] args) {

        int num =10;
        int[][] arrInt = new int[num][];
        for (int i = 0; i < num; i++) {
            arrInt[i] =new int[i+1];
        }

        for (int i = 0; i < arrInt.length; i++) {
            for (int j = 0; j < arrInt[i].length; j++) {
                int sum = 1;
                for (int k = 1; k <j; k++) {
                    sum = sum*(i-k+1)/k;
                }
                arrInt[i][j] = sum;
            }
            System.out.println("");
        }

       for (int[] a:arrInt){
           for (int b:a){
               System.out.print(" "+b);
           }
           System.out.println();
       }

    }
}
